/*	编写函数把一个数组中所有存储区的内容前后颠倒.
 *
 */

#include<stdio.h>
void diandao(int a[], int size);	

int main () {
	int num = 0;
	printf("输入整数个数:");
	scanf("%d", &num);
	int a[num];
	printf("输入%d个数:", num);
	for (int i = 0; i < num; i++) {
		scanf("%d", &a[i]);
	}
	diandao(a, num);
	for (int i = 0; i < num; i++) {
		printf("%d ", a[i]);
	}
	printf("\n");

	return 0;
}

/*
void diandao(int a[], int size) {	
	int diandao[size];
	for (int i = 0; i < size; i++) {
		diandao[i] = a[size - 1 - i];
	}
	for (int i = 0; i < size; i++) {
		a[i] = diandao[i];
	}
}
*/

void diandao(int a[], int size) {
	int pre = 0, post = size - 1;
	for (;pre < post;pre++, post--) {
		int tmp = a[pre];
		a[pre] = a[post];
		a[post] = tmp;
	}
}
